#include "ResearchTask.h"

ResearchTask::ResearchTask(int pTaskId, int pResearchLevel, int pTimeToComplete)
{
	taskId = pTaskId;
	researchLevel = pResearchLevel;
	timeToComplete = pTimeToComplete;
	initialTime = timeToComplete;
}

bool ResearchTask::isCompleted()
{
	if(timeToComplete <= 0)
	{
		return true;
	}
	return false; 
}

double ResearchTask::getTimeToComplete(){return timeToComplete;}

void ResearchTask::setTimeToComplete(double pTimeToComplete)
{
	timeToComplete = pTimeToComplete;
}

string ResearchTask::getTaskName()
{
	return RESEARCH_TASK_NAMES[taskId];
}

int ResearchTask::getTaskId(){return taskId;}

int ResearchTask::getResearchLevel() { return researchLevel; }

int ResearchTask::getProgress() 
{
	return (int)((timeToComplete/initialTime) * 100);
}